package com.wisdom.bean.Demo1;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.Resource;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 11951
 * Date: 2025-03-13
 * Time: 20:48
 */
@Component(value = "myStudent")
@Scope
@Data
public class Student {
    @Value("12")
    int age;
    @Value("张三")
    String name;
    @Resource
    Book book;
    @Qualifier("myBook")
    @Autowired
    Book book1;

    @PostConstruct
    public void init (){
        System.out.println("初始化");
    }
}
